//
//  BackgroundLayer.h
//  SCRAP_ObjC
//
//  Created by Capstone Design Fall 2010 on 10/18/10.
//  Copyright 2010 Thunderwear. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import <UIKit/UIKit.h>
#import <GameKit/GameKit.h>
#import "Card.h"
#import "CardData.h"
#import "iPhoneSession.h"


@interface BackgroundLayer : CCLayer {
	CardData * cardData;
	
	CCSprite *portal;
	CCSprite *background;
	
	CCSprite *reserveBack;	
	CCSprite *stockBack;
	
	CCLabel *messageLabel;
	CCLabel *scoreLabel;
	CCLabel *cardsLeft;
	
	CGSize size;
	CGPoint center;
	CCColorLayer * lockLayer;	
	
	CGPoint reservePoint;
	CGPoint stockPoint;
	NSMutableArray * wastePoints;	// location on screen
	NSMutableArray * cascadePoints;
	
	bool isMoving;
	bool isLocked;
	bool isPlaying;
	bool touchedStock;
	bool hasPlayedWaste;
	int score;
	float cardHeight, cardWidth;
	NSString * colorName;
	ccColor3B _color;
	
	iPhoneSession *gameSession;
	UIActivityIndicatorView *active;

	/*
	// networking
	GKSession		*gameSession;
	NSString		*gamePeerId;
	UIActivityIndicatorView *active;
	 */
}

- (void) setPicker;
- (void) startLock;
- (void) setUpBasicVisuals;
- (void) stopLock;
- (void) drawCards;
- (void) handleFlipReserve;
- (void) cardAccepted;
- (void) cardReturned;
- (void) sendCard:(Card*)x;
- (void) startRound;
- (void) endRound;
- (void) resetAssets;
- (void) setScore:(int)n;
- (float) distanceBetweenPointA:(CGPoint)a pointB:(CGPoint)b;
- (void) vibrate;

/*
- (void) startPicker;
- (void)invalidateSession:(GKSession *)session;
*/

@end
